﻿#ifndef UTILS_H
#define UTILS_H

#include <QSettings>
#include <QFile>
#include <QDir>
#include <QDebug>

#include "global.h"



class PlotChartUtils
{
public:


    static PlotChartUtils& GetInstance()
    {
        static PlotChartUtils instance;
        return instance;
    }

    /*数据格式： 0 "line1" "(0,1)-(2,0)-(3,0)-(4,1)-(5,1)-(6,0)"*/
    void writeConfData(QString path, QList<ConfData> listConf);
    QList<ConfData> getConfData();
    QList<ConfData> getConfData(QString path);
    void removeConfDataItem(QString path, QList<ConfData> listConf, int itemIndex);

    // 获取多个INI数据
//    QList<ConfData> getConfDataMore(QStringList listName);

    QList<QString> getLocalPathConfFileName(QString path);



private:
    QList<QPointF> strToListPoint(QString strPoint);
    QString listPointToStr(QList<QPointF> listPoint);



private:
    PlotChartUtils(){}
    PlotChartUtils(PlotChartUtils const&);
    PlotChartUtils& operator == (const PlotChartUtils&);

};

#endif // UTILS_H
